home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / k3btoolbox.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-05-27  |  2.2 KB  |  94 lines

  1. /* 
  2.  *
  3.  * $Id$
  4.  * Copyright (C) 2003 Sebastian Trueg <trueg@k3b.org>
  5.  *
  6.  * This file is part of the K3b project.
  7.  * Copyright (C) 1998-2007 Sebastian Trueg <trueg@k3b.org>
  8.  *
  9.  * This program is free software; you can redistribute it and/or modify
  10.  * it under the terms of the GNU General Public License as published by
  11.  * the Free Software Foundation; either version 2 of the License, or
  12.  * (at your option) any later version.
  13.  * See the file "COPYING" for the exact licensing terms.
  14.  */
  15.  
  16. #ifndef K3B_TOOLBOX_H
  17. #define K3B_TOOLBOX_H
  18.  
  19. #include <qframe.h>
  20. #include <qstring.h>
  21. #include <qtoolbutton.h>
  22. #include <qptrlist.h>
  23. #include "k3b_export.h"
  24.  
  25. class KAction;
  26. class KToggleAction;
  27. class KWidgetAction;
  28. class QGridLayout;
  29. class QPopupMenu;
  30. class QResizeEvent;
  31.  
  32.  
  33. /**
  34.  * internal class. Do not use!
  35.  */
  36. class LIBK3B_EXPORT K3bToolBoxButton : public QToolButton
  37. {
  38.   Q_OBJECT
  39.  
  40.  public:
  41.   K3bToolBoxButton( KAction*, QWidget* parent );
  42.   K3bToolBoxButton( const QString& text, const QString& icon, 
  43.             const QString& tooltip, const QString& whatsthis,
  44.             QObject* receiver, const char* slot,
  45.             QWidget* parent );
  46.  
  47.  private slots:
  48.   void slotPopupActivated();
  49.  
  50.  protected:
  51.   void resizeEvent( QResizeEvent* );
  52.  
  53.  private:
  54.   QPopupMenu* m_popupMenu;
  55. };
  56.  
  57.  
  58. class LIBK3B_EXPORT K3bToolBox : public QFrame
  59. {
  60.   Q_OBJECT
  61.  
  62.  public:
  63.   K3bToolBox( QWidget* parent = 0, const char* name = 0 );
  64.   ~K3bToolBox();
  65.  
  66.   K3bToolBoxButton* addButton( const QString& text, const QString& icon, 
  67.                    const QString& tooltip = QString::null, const QString& whatsthis = QString::null,
  68.                    QObject* receiver = 0, const char* slot = 0,
  69.                    bool forceTextLabel = false );
  70.   K3bToolBoxButton* addButton( KAction*, bool forceTextLabel = false );
  71.   K3bToolBoxButton* addToggleButton( KToggleAction* );
  72.   void addWidgetAction( KWidgetAction* );
  73.  
  74.   /**
  75.    * Be aware that the toolbox will take ownership of the widget
  76.    * and destroy it on destruction. Becasue of this it is not fitted
  77.    * for WidgetActions.
  78.    */
  79.   void addWidget( QWidget* );
  80.   void addLabel( const QString& );
  81.   void addSpacing();
  82.   void addSeparator();
  83.   void addStretch();
  84.  
  85.   void clear();
  86.  
  87.  protected:
  88.   QGridLayout* m_mainLayout;
  89.   QPtrList<QWidget> m_doNotDeleteWidgets;
  90. };
  91.  
  92.  
  93. #endif
  94.